<?php
	session_start();
	
	//validate user not logged in; if logged in, redirect to home
	if(isset($_SESSION['employee_id'])){
		header("location:home.php");
	}
	
	//redirect to mobile version if mobile
	include "controller/php/mobile_handler.php";
	if(IsMobile()) {
		header("location:mobile/login.php");
	}
	
?>

<html>
	<head>
		<link rel="stylesheet" type="text/css" href="view/css/application.css" />
		<script type="text/javascript" src="view/javascript/application.js" ></script>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
	</head>
	
	
<body>
			
	<div id="content">
		<center>	
			
			<img src="view/img/logo2.jpg">
			
			<div id="error_msg">
				<p>
					<?php
						include "controller/php/error_handler.php";
					
						if(isset($_GET['error']))
						{
							$errMsg = GetErrorMsgForId($_GET['error']);
							echo "$errMsg";
						}
					?> &nbsp;
				</p>
			</div>
			
			<form action="controller/php/validate_login.php" method="post" id="loginFormTable">
				<table border="1">
					<tr>
						<td>
							<p>
								Employee ID
							</p>
						</td>
						<td>
							<input type="text" name="employee_id" />
						</td>
					</tr>
					<tr>
						<td>
							<p>
								Password
							</p>
						</td>
						<td>
							<input type="password" name="password" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<button type="submit">Login</button>
						</td>
					</tr>
				</table>
			</form>
		</center>
	</div>
</body>

</html>

